import { MongoClient, ServerApiVersion } from "mongodb";

const uri = "mongodb+srv://vegetablecaii:vegetablecaii@viya.z4btj.mongodb.net/?retryWrites=true&w=majority&appName=viya";
export const mongo = new MongoClient(uri, {
    appName: "viya",
    serverApi: {
        version: ServerApiVersion.v1,
        strict: false,
        deprecationErrors: true,
    },
    // 连接池配置
    maxPoolSize: 100,
    minPoolSize: 2,
    maxConnecting: 10,
    maxIdleTimeMS: 30000
})